package com.amqr.movetest.widget;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

/**
 * User: LJM
 * Date&Time: 2017-05-20 & 22:43
 * Describe: Describe Text
 * 自定义的InterceptViewPager
 * 在dispatchTouchEvent方法里直接调用requestDisallowInterceptTouchEvent(true);
 * 作用是放父容器不拦截Touch，也就是本View直接使用
 */
public class InterceptViewPager extends ViewPager {
    public InterceptViewPager(Context context) {
        super(context);
    }

    public InterceptViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
    }


    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        //requestDisallowInterceptTouchEvent(true);

        return super.dispatchTouchEvent(ev);

    }
}
